package br.com.locanet.exception;

import java.util.ArrayList;
import java.util.List;
import java.lang.Exception;

@SuppressWarnings("serial")
public class ExceptionList extends Exception {
	private List<Exception> listaErros = new ArrayList<Exception>();

	public List<Exception> getListaErros() {
		return listaErros;
	}

	public void add(final Exception exception){
		getListaErros().add(exception);
	}
	
	@Override
	public String getMessage() {
		String retorno = "";
		for (Exception e : getListaErros())
			retorno+=e.getMessage()+"\n";
		return retorno;
	}
}
